package se.webbzon.oschi01.nbt;

import se.webbzon.oschi01.nbt.TagEvent.Action;

public class FloatTag extends AbstractTag<Float> {
	
	private float f;
	
	public FloatTag(TagFactory<Float> factory, String tagName, float f) {
		super(factory, tagName);
		this.f = f;
	}

	@Override public long size() {
		return 4;
	}

	@Override public Float getValue() {
		return f;
	}

	@Override public void setValue(Float value) {
		this.f = value;
		broadcastEvent(new TagEvent(this,Action.CHANGED,value));
	}

	@Override public Class<Float> getValueClass() {
		return Float.class;
	}

	@Override public AbstractTag<Float> clone() {
		return new FloatTag(getFactory(),this.toString(),f);
	}

}
